package com.example.provider.service

import com.example.common.service.RemarkDubboService
import org.apache.dubbo.config.annotation.DubboService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.data.redis.core.StringRedisTemplate
import org.springframework.stereotype.Service

@DubboService
class RemarkServiceImpl : RemarkDubboService {
    @Autowired
    private lateinit var redis: StringRedisTemplate

    override fun saveToRedis(key: String, value: String) {
        redis.opsForValue().set(key, value)
    }

    override fun findFromRedis(key: String): String? {
        return  redis.opsForValue().get(key)
    }

    override fun deleteFromRedis(key: String) {
        redis.delete(key)
    }
}
